import Vue from 'vue'
import ElementUI from 'element-ui'
import App from './App.vue'
import router from './router'
import rsa from '@/util/rsa'
import { isTokenExpired } from '@/util/jwt'
import service, { postRequest, getRequest, putRequest, deleteRequest } from '@/util/https'

// 导入样式
import 'element-ui/lib/theme-chalk/index.css'
import 'bpmn-js/dist/assets/diagram-js.css'
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn.css'

// 将请求方法挂载到 Vue 原型上
Vue.prototype.$axios = service
Vue.prototype.$post = postRequest
Vue.prototype.$get = getRequest
Vue.prototype.$put = putRequest
Vue.prototype.$delete = deleteRequest

// 将 rsa 工具挂载到 Vue 原型上
Vue.prototype.$rsa = rsa

// 将 jwt 工具挂载到 Vue 原型上
Vue.prototype.$jwt = {
  isTokenExpired
}

Vue.use(ElementUI)

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
